package com.yangle.frame.admin.service;

import com.yangle.frame.admin.entity.FrameUser;
import com.yangle.frame.admin.mapper.FrameUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * Created by yangle on 2017/9/24.
 */
@Service
public class FrameUserService{
    @Autowired
    private FrameUserMapper frameUserMapper;


    public FrameUser getUser(String id) {
        return frameUserMapper.getUserById(id);
    }


    public FrameUser getUserByName(String userid) {
        return frameUserMapper.getUserByName(userid);
    }

    public List<Map<String, Object>> getUsers() {
        return frameUserMapper.getUsers();
    }

    public void save(FrameUser frameUser){
        if(frameUser.getId()==null){
            frameUser.setId(UUID.randomUUID().toString());
            frameUserMapper.create(frameUser);
        }else{

        }

    }

}
